package com.yckj.day03;

/**
 * TODO 使用do...while循环对1+2+3+...+100进行求和
 *
 * @author shengyuee
 * @version 1.0
 * 2025/7/18 11:16
 */
public class DoWhileDemo1 {
    public static void main(String[] args) {
        int n = 1;
        int sum = 0;
        do{
            sum += n; // sum=sum+n;
            n++;
        }while(n<=100);
        System.out.println("sum = " + sum);
    }
}
